﻿using System;
using System.Windows.Forms;

namespace MyPaint
{
    public partial class FrmImageSetting : Form
    {
        public int icoHeight,icoWidth ;//ICO
        public int gifHeight,gifWidth;//PPGIF

        public FrmImageSetting(int width = 0, int height = 0, string SizeFor = "")
        {
            InitializeComponent();

            if (SizeFor == "")
            {
                this.txtICOWidth.Text = width.ToString();
                this.txtICOHeight.Text = height.ToString();
            }
            else if (SizeFor == "PPGIF")
            {
                this.txtGIFWidth.Text = width.ToString();
                this.txtGIFHeight.Text = height.ToString();
            }

        }

        private void FrmSetting_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                icoWidth = int.Parse(txtICOWidth.Text);
                icoHeight = int.Parse(txtICOHeight.Text);

                gifWidth = int.Parse(txtGIFWidth.Text);
                gifHeight = int.Parse(txtGIFHeight.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }
}
